<template>
    <div>
        <a-modal
            v-model:visible="visible"
            :title="formState.title"
            @ok="handleOk"
            @cancel="visible = false"
            width="100%"
            wrapClassName="full-modal"
            :footer="null"
        >
            <div :key="earlyWarningKey">
                <div v-if="formState.title == '证件预警'">
                    <certificateAlert :onlyCurrentUser="false" :fqyid="formState.fqyid" />
                </div>
                <div v-if="formState.title == '关键指标预警'">
                    <keyIndicators :onlyCurrentUser="false" :fqyid="formState.fqyid"/>
                </div>
                <div v-if="formState.title == '物料预警'">
                    <materialWarning :onlyCurrentUser="false" :fqyid="formState.fqyid"/>
                </div>
                <div v-if="formState.title == '生产环境预警'">
                    <productEnvironment :onlyCurrentUser="false" :fqyid="formState.fqyid"/>
                </div>
            </div>
        </a-modal>
    </div>
</template>
<script>
import certificateAlert from '../enterprise/earlyWarning/certificateAlert.vue'
import keyIndicators from '../enterprise/earlyWarning/keyIndicators.vue'
import materialWarning from '../enterprise/earlyWarning/materialWarning.vue'
import productEnvironment from '../enterprise/earlyWarning/productEnvironment.vue'
export default {
    components:{
        certificateAlert,
        keyIndicators,
        materialWarning,
        productEnvironment,
    },
    props:{

    },
    data(){
        return{
            visible:false,
            formState:{},
            earlyWarningKey:null,
        }
    },
    watch:{

    },
    mounted(){
        
    },
    methods:{
        getData(val){
            this.formState = val
            this.earlyWarningKey = Date.now()
        },
        handleOk(){
            this.visible = false
        }
    }
}
</script>